﻿using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System.ComponentModel.Design;

namespace SampleControls {
    internal class ContentSerializationWithSmartTagActionList : ActionListBase {
        #region Properties

        private readonly ContentSerializationWithSmartTag linkedControl;

        [Editor(typeof(ContentSerializationWithSmartTagEditor), typeof(UITypeEditor))]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public IRelatedEndDescription[] RelatedEndDescriptions {
            get { return (IRelatedEndDescription[])GetPropertyByName("RelatedEndDescriptions").GetValue(linkedControl); }
            set { GetPropertyByName("RelatedEndDescriptions").SetValue(linkedControl, value); }
        }

        #endregion

        /// <summary>
        /// TODO
        /// </summary>
        /// <param name="component"></param>
        /// <param name="designer"></param>
        public ContentSerializationWithSmartTagActionList(ContentSerializationWithSmartTag component, ControlDesigner designer)
            : base(component, designer) {
            linkedControl = (ContentSerializationWithSmartTag)LinkedControl;
        }

        /// <summary>
        /// TODO
        /// </summary>
        /// <returns></returns>
        public override DesignerActionItemCollection GetSortedActionItems() {
            var items = new DesignerActionItemCollection();

            items.Add(new DesignerActionHeaderItem("Data"));

            items.Add(new DesignerActionPropertyItem(
                "RelatedEndDescriptions", "RelatedEnd Descriptions", "Data", "Choose the entity collections to eager load."));

            //items.Add(new DesignerActionHeaderItem("Teste"));

            //items.Add(new DesignerActionPropertyItem(
            //    "RelatedEndDescriptions", "teste 1", "Teste", "blah."));

            //items.Add(new DesignerActionPropertyItem(
            //    "RelatedEndDescriptions", "teste 2", "Teste", "bligh."));
    

            return items;
        }
    }
}
